<?php

namespace Drupal\shushengyuan\Schemas;

use Drupal\shusy_store_level\Entity\ShusyStoreLevel;

/**
 * @OA\Schema(
 *   schema="StoreLevel",
 *   type="object",
 *   description="StoreLevel"
 * )
 */
class StoreLevel extends AbstractBaseModel {

  protected function getEntityType() {
    return 'shusy_store_level';
  }

  protected function setValue() {
    if ($this->entity instanceof ShusyStoreLevel) {
      $value = [
        /**
         * @OA\Property(
         *   property="id",
         *   type="integer",
         *   description="ID",
         * ),
         */
        'id' => (int) $this->entity->id,
        /**
         * @OA\Property(
         *   property="name",
         *   type="string",
         *   description="等级名",
         * ),
         */
        'name' => (string) $this->entity->name,
        /**
         * @OA\Property(
         *   property="rebate",
         *   type="string",
         *   description="比例折扣",
         * ),
         */
        'rebate' => (string) $this->entity->name,
        /**
         * @OA\Property(
         *   property="amount",
         *   type="string",
         *   description="需累计进货",
         * ),
         */
        'amount' => (string) $this->entity->name,
      ];
      $this->merge($value);
    }
  }
}
